<?php
/**
 * Basic ACL for the EICms
 * 
 * @package EICms
 * @author hcderaad
 * @todo Store and load the acl from the db.
 */
class EICms_Acl extends Zend_Acl {
	
	/**
	 * Constructor sets up the basic acl.
	 *
	 * @param Zend_Auth $auth
	 */
	public function __construct(Zend_Auth $auth) {
		$this->add(new Zend_Acl_Resource('default'));
		$this->add(new Zend_Acl_Resource('member'));
		$this->add(new Zend_Acl_Resource('author'));
		$this->add(new Zend_Acl_Resource('admin'));
		
		$this->addRole(new Zend_Acl_Role('guest'));
		$this->addRole(new Zend_Acl_Role('member'),'guest');
		$this->addRole(new Zend_Acl_Role('author'),'member');
		$this->addRole(new Zend_Acl_Role('admin'),'author');
		
		$this->allow('guest','default');
		$this->allow('member','member');
		$this->allow('author','author');
		$this->allow('admin','admin');
		
	}
}
?>